Skip to content

Thaana and locale (#66, Part 3) - #72

Merged
n4ff4h merged 10 commits into
devfrom
fix/66-part3-thaana-locale
Nov 18, 2026
Merged

n4ff4h merged 10 commits into
devfrom
fix/66-part3-thaana-locale

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes Part 3 of #66 (Thaana and locale): each item has a test that failed first, and gets its own commit and changeset.

Item Change
3.1 useThaanaInput(options) and useThaanaField(thaana) now return a callback ref and attach to the element held in state, so the keyboard follows the DOM node. CommandPalette thaana now types Thaana on every open, and TextInput keeps working after endAddon replaces the input. All callers were updated; useMergedRef takes a third ref.
3.2 Typing on a closed thaana select seeds the search with the transliterated key (ކ), using the configured keymap. It stays Latin when defaultEnabled: false.
3.3 isLatinKeyboardText now accepts tabs and line breaks, so paste: "transliterate" converts multi-line pastes.
3.5 When onToggle is given, attachThaanaKeyboard passes it the requested state and leaves the change to the owner. The hook applies it through its own (controlled or uncontrolled) state, so a parent that keeps enabled={true} no longer leaves the field RTL with Latin typing. Without onToggle, the shortcut still flips the mode itself.
3.6 i18n/format.ts calls registerEnglish({ common }). english-registry.test.ts no longer skips i18n/.
3.7 Dhivehi date-fns dayPeriod now maps midnight, night and morning to AM and noon, afternoon and evening to PM. match.day parses full, short and narrow names, trying the longest name first.
3.8 The confirm title for a named action comes from the new listing.actionRecordTitle (en "{action} {name}?", dv "{name} {action}؟"). Only deletes add "This can't be undone."
3.9 The ChartTooltipContent default formatter uses useFormatNumber, and DataTable Date cells use useFormatDate, instead of the browser locale.
3.10 OnuProvider retries a failed on-demand locale load after 1, 3 and 10 s, then once more on the browser's online event.

Skipped ([P] / device check)

  • 3.4 (all three sub-bullets, the composition path): the issue asks for a test on a real Android device before any change.

Could not reproduce

  • None.

Behaviour and API changes worth noting

  • useThaanaInput(ref, options) is now useThaanaInput(options), returning { ref, enabled, setEnabled, toggle }. useThaanaField(ref, thaana) is now useThaanaField(thaana), returning { ref, … } (ref is undefined when thaana is falsy). The docs (guides/thaana-input, text-inputs/thaana-toggle) and the demo are updated.
  • attachThaanaKeyboard's onToggle now means "the shortcut asks for this state". Call setEnabled to apply it.
  • New locale key: listing.actionRecordTitle (en and dv). Non-delete confirm dialogs no longer have a default description.

Verification

  • pnpm lint, pnpm format:check, pnpm typecheck: pass
  • vitest run --maxWorkers=3 (full library suite): 198 files, 2874 passed, 1 skipped
  • vitest run --coverage src/thaana: every src/thaana file is at 100% lines, branches, functions and statements
  • node scripts/check-docs.mjs: Docs OK
  • pnpm build: pass. pnpm --filter @javaabu/onu size: all budgets pass, none raised.

🤖 Generated with Claude Code

agent and others added 10 commits November 18, 2026 05:35
…lement (#66, 3.1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 3.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, 3.9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…3-thaana-locale

# Conflicts:
#	packages/onu/src/hooks/use-merged-ref.ts
@n4ff4h
n4ff4h merged commit 1bb3df1 into dev Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant